import request from '@/utils/request'

const baseRequest = (path: string) => `/api/user/${path}`


export const userGetInfoService = (id: string) => request.get(baseRequest(`${id}`))

export const userLoginService = ({ username, password }: any) =>
    request.post(baseRequest('login'), { username, password })

export const userRegisterService = ({ username, password }: any) =>
    request.post(baseRequest('register'), { username, password })

export const userUpdateService = (info: any) => request.put(baseRequest('update'), info)

export const userDeleteService = (id: string) => request.delete(baseRequest(`del/${id}`))
